package logicclient;

import static org.junit.Assert.*;

import org.junit.Test;

import stuff.Goods;

import ClientLogic.ISell;
import ClientLogic.Sell;


public class SellTest {
	ISell sell = new Sell("AB2011001");
	@Test
	public void testShowGoodsInfo(){
		Goods g = sell.showGoodsInfo("1");
		assertEquals("2", g.getGiftID());
		assertEquals("cup", g.getDescription());
		assertEquals("2011-10-24", g.getEdible());
		assertEquals("2012-10-24", g.getUnedible());
	}
	
	@Test
	public void testAddGoods(){
		Goods g = sell.addGoods("2", 2);
		assertEquals(2, g.getNumber());
		assertEquals("cookie", g.getDescription());
	}
	
	@Test
	public void testStartSelling(){
		sell.addGoods("2", 2);
		sell.addGoods("1", 1);
		double sum = sell.startSelling();
		//assertEquals(31.5, sum);
		System.out.println(sum);
	}
}
